package ee.siimkaspar.subjects.model;


import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;

@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
@Entity
@Table(name = "enterprise_person_relation")
public class EnterprisePersonRelation implements Serializable, ModelInterface {

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "enterprise_person_relation", unique = true, nullable = false)
	private Integer id;
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ent_per_relation_type_fk")
	private EntPerRelationType entPerRelationType;
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "person_fk")
	private Person person;
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "enterprise_fk")
	private Enterprise enterprise;

	public EnterprisePersonRelation() {
	}

	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public EntPerRelationType getEntPerRelationType() {
		return this.entPerRelationType;
	}

	public void setEntPerRelationType(EntPerRelationType entPerRelationType) {
		this.entPerRelationType = entPerRelationType;
	}

	public Person getPerson() {
		return this.person;
	}

	public void setPerson(Person person) {
		this.person = person;
	}

	public Enterprise getEnterprise() {
		return this.enterprise;
	}

	public void setEnterprise(Enterprise enterprise) {
		this.enterprise = enterprise;
	}
	@Override
	public boolean validate() {
		// TODO Auto-generated method stub
		return true;
	}
}
